package com.Xht.www.serviceImpl;
//处理游客事务的接口的实现
import java.util.List;
import com.Xht.www.dao.MerchantInfoDAO;
import com.Xht.www.po.MerchantInfoPO;
import com.Xht.www.service.Visitor;

public class VisitorImpl implements Visitor {

    private final MerchantInfoDAO merchantInfoDAO = new MerchantInfoDAO();

    @Override
    public List<MerchantInfoPO> getApprovedMerchants(String sortField, String sortOrder) {
        return merchantInfoDAO.getAllMerchantInfoSorted(sortField, sortOrder);
    }

    @Override
    public List<MerchantInfoPO> searchApprovedMerchants(String keyword, String sortField, String sortOrder, int pageNumber, int pageSize) {
        return merchantInfoDAO.searchApprovedMerchants(keyword, sortField, sortOrder, pageNumber, pageSize);
    }

    @Override
    public List<MerchantInfoPO> searchApprovedMerchantsByName(String keyword, String sortField, String sortOrder, int pageNumber, int pageSize) {
        return merchantInfoDAO.searchApprovedMerchantsByName(keyword, sortField, sortOrder, pageNumber, pageSize);
    }

    @Override
    public List<MerchantInfoPO> searchApprovedMerchantsByKeyword(String keyword, String sortField, String sortOrder, int pageNumber, int pageSize) {
        return merchantInfoDAO.searchApprovedMerchantsByKeyword(keyword, sortField, sortOrder, pageNumber, pageSize);
    }

    @Override
    public int countApprovedMerchants(String keyword) {
        return new MerchantInfoDAO().countApprovedMerchants(keyword);
    }

    @Override
    public int countApprovedMerchantsByName(String keyword) {
        return new MerchantInfoDAO().countApprovedMerchantsByName(keyword);
    }

    @Override
    public int countApprovedMerchantsByKeyword(String keyword) {
        return new MerchantInfoDAO().countApprovedMerchantsByKeyword(keyword);
    }

}



